﻿using LDC_Shop_A.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LDC_Shop_A.Service
{
    public interface ICarService
    {
        /// <summary>
        /// 加入购物车
        /// </summary>
        void AddCarForRedis(string userId, int goodId);

        /// <summary>
        /// 减少购物车商品
        /// </summary>
        void DiffCarForRedis(string userId, int goodId);

        /// <summary>
        /// 删除购物车商品
        /// </summary>
        void DeleteCarForRedis(string userId, int goodId);

        /// <summary>
        /// 购物车商品列表
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        List<CarGoodModel> GetCarGoods(string userId);

        /// <summary>
        /// 添加购物车
        /// </summary>
        bool AddCardForSQL(int userId, int goodId);

        /// <summary>
        /// 减少购物车商品
        /// </summary>
        /// <returns></returns>
        bool DiffCarForSQL(int userId, int goodId);

        /// <summary>
        /// 删除购物车商品
        /// </summary>
        /// <returns></returns>
        bool DeleteCarForSQL(int userId, int goodId);
        /// <summary>
        /// 清空购物车商品
        /// </summary>
        /// <returns></returns>
        void RemoveCarForSQL(int userId);
        /// <summary>
        /// 购物车商品列表
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        List<CarGoodModel> GetCarGoodsForSQL(int userId);
    }
}
